//-----------------------------------------------------------------------
//<copyright file="PhieuGiaoHangBLL.cs
//Code gen by tool.
//</copyright>
//-----------------------------------------------------------------------
using System;
using PMS.Exceptions;
using System.Collections.Generic;
using PMS.DAL;
using PMS.Entity;

namespace PMS.BLL
{
	public class PhieuGiaoHangBO : BaseBO
	{
		// Interface Instant Object
		private readonly IPhieuGiaoHangDAO phieugiaohangInterfaceObject = null;

		// Constructor
		public PhieuGiaoHangBO()
		{
			phieugiaohangInterfaceObject = new DAL.ServiceFactory<IPhieuGiaoHangDAO>().CurrentDAL;
		}

		#region PhieuGiaoHang

		/// <summary>
		///
		/// </summary>
		/// <param name="phieugiaohang"></param>
		public PhieuGiaoHang CreatePhieuGiaoHang(PhieuGiaoHang phieugiaohang)
		{
			try
			{
				return phieugiaohangInterfaceObject.CreatePhieuGiaoHang(phieugiaohang);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access CreatePhieuGiaoHang Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="phieugiaohang"></param>
		public void UpdatePhieuGiaoHang(PhieuGiaoHang phieugiaohang)
		{
			try
			{
				phieugiaohangInterfaceObject.UpdatePhieuGiaoHang(phieugiaohang);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access UpdatePhieuGiaoHangException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="phieugiaohang"></param>
		public void DeletePhieuGiaoHang(PhieuGiaoHang phieugiaohang)
		{
			try
			{
				phieugiaohangInterfaceObject.DeletePhieuGiaoHang(phieugiaohang);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access DeletePhieuGiaoHangException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		public PhieuGiaoHangs GetAllPhieuGiaoHang()
		{
			try
			{
				return phieugiaohangInterfaceObject.GetAllPhieuGiaoHang();
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetAllPhieuGiaoHang Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="soPX"></param>
		public PhieuGiaoHang GetPhieuGiaoHangByID(string soPG)
		{
			try
			{
				return phieugiaohangInterfaceObject.GetPhieuGiaoHangByID(soPG);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetPhieuGiaoHangBy ID Exception", ex);
			}
		}

        /// <summary>
        ///
        /// </summary>
        /// <param name="soPX"></param>
        public PhieuGiaoHang GetPhieuGiaoHangBySoPX(string soPX)
        {
            try
            {
                return phieugiaohangInterfaceObject.GetPhieuGiaoHangBySoPX(soPX);
            }
            catch (Exception ex)
            {
                throw BusinessException.GetException("Business Access GetPhieuGiaoHangBy ID Exception", ex);
            }
        }

        public PhieuGiaoHangs GetPhieuGiaoHangByDate(DateTime? tungay, DateTime? denngay)
        {
            try
            {
                return phieugiaohangInterfaceObject.GetPhieuGiaoHangByDate(tungay, denngay);
            }
            catch (Exception ex)
            {
                throw BusinessException.GetException("Business Access GetPhieuGiaoHangByDate Exception", ex);
            }
        }


		#endregion
	}
}
